from typing import *


class Solution:

    def diagonalSum(self, mat: List[List[int]]) -> int:
        n = len(mat)
        i = t = 0
        while i < n:
            t += mat[i][i] + mat[i][n - i - 1]
            i += 1
        t -= 0 if n & 1 == 0 else mat[n//2][n//2]   
        return t

s = Solution()
print(s.diagonalSum([[7,3,1,9],[3,4,6,9],[6,9,6,6],[9,5,8,5]]))